using DataLayer.Model.enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DataLayer.Model
{
    public class OutdoorExerciseSocial
    {
        [Key, ForeignKey("OutdoorExercise")]
        public int Id { get; set; }

        [Required]
        [MaxLength(50)]
        public string Name { get; set; }

        [NotMapped]
        public OutdoorExerciseType Type
        {
            get
            {
                if (!OutdoorExercise.Floors.HasValue)
                    return OutdoorExerciseType.Walking;
                else
                    return OutdoorExerciseType.Climbing;
            }
        }

        [MaxLength(100)]
        public string Description { get; set; }

        [MaxLength(50)]
        public string ImageUrl { get; set; }

        public virtual PlayerGroup PlayerGroup { get; set; }

        [Required]
        public virtual OutdoorExercise OutdoorExercise { get; set; }

        public virtual ICollection<OutdoorExerciseSocial_CheerMessage> OutdoorExerciseSocial_CheerMessage { get; set; }

        public OutdoorExerciseSocial()
        {
            this.OutdoorExerciseSocial_CheerMessage = new List<OutdoorExerciseSocial_CheerMessage>();
        }
    }
}
